using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//��ɫ����״̬
public class PlayerIdleState : PlayerGroundedState
{
    public PlayerIdleState(Player _player, PlayerStateMachine _playerStateMachine, string _animBoolName) : base(_player, _playerStateMachine, _animBoolName)
    {

    }

    public override void Enter()
    {
        base.Enter();

        player.currentJumpCount = 0;

        //��������״̬�ٶ�
        rb.velocity = new Vector2(0, rb.velocity.y);
    }

    public override void Update()
    {
        base.Update();

        //ʵʱ����Ƿ���x�����룬�����ж��Ƿ��л����ƶ�״̬
        if (xInput != 0 && (player.IsGroundDetected()))
            player.stateMachine.ChangeState(player.moveState);
    }

    public override void Exit()
    {
        base.Exit();
    }
}
